<?php 
/** *
**********************************************************
* CYLON PARAMETER file                                   *
* ------------------------------------------------------ *
*  cylon.zip   - in root or update folder /              *
*                cylon installation files                *
*  install.zip - in root or update folder /              *
*                delete all file exept cylon             * 
*                and install files                       *
*  *.zip       - update folder                           *
*                update files from zip file              *
*  *.sql       - update folder                           *
*                update database from sql file           *
*                                                        *
* ZIP files                                              *
*  /files      - remove "files/" from source path        *
*  /database   - dont install file,                      *
*                only use .sql in this folder            *
*  any file    - copy file with full path into root      * 
*                                                        *
**********************************************************
*/ 
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  header("Last-Modified: " . gmdate("D, d M Y H:i: s") . " GMT");
  header("Cache-Control: no-store, no-cache, must-revalidate");
  header("Cache-Control: post-check=0, pre-check=0", false);
  header("Pragma: no-cache");
  header('Content-type: application/xml; charset=utf-8');

  include_once('config.php');
  
  $SafeFile = @$_FILES['uploaded']['name']; 
  $SafeFile = str_replace("#", "No.",    $SafeFile); 
  $SafeFile = str_replace("$", "Dollar", $SafeFile); 
  $SafeFile = str_replace("%", "Percent",$SafeFile); 
  $SafeFile = str_replace("^", "",       $SafeFile); 
  $SafeFile = str_replace("&", "and",    $SafeFile); 
  $SafeFile = str_replace("*", "",       $SafeFile); 
  $SafeFile = str_replace("?", "",       $SafeFile); 
  $XML = new xmlWriter();
  $XML->openURI('php://output'); 
  $XML->startDocument('1.0','UTF-8');
  $XML->setIndent(4);
  
  if(@copy(@$_FILES['uploaded']['tmp_name'], ROOT.UPDATE.$SafeFile)){ //IF IT HAS BEEN COPIED... 
   $XML->startElement('cylon_upload_robot'); 
     $XML->writeAttribute('version', VERSION); 
     $XML->writeAttribute('sourcelink', @$_SERVER['HTTP_HOST'] ); 
     $XML->startElement ('upload_file');
       $XML->writeAttribute('process', 'successful');         
       $XML->writeElement ('file_name', @$_FILES['uploaded']['name']);
       $XML->writeElement ('file_size', round(@$_FILES['uploaded']['size']/1000)."KB");
       $XML->writeElement ('max_size', ini_get('post_max_size'));
       $XML->writeElement ('upload_directory', ROOT.UPDATE);
     $XML->endElement ();
   $XML->endElement (); 
  } else { 
   $XML->startElement('cylon_upload_robot'); 
     $XML->writeAttribute('version', VERSION); 
     $XML->writeAttribute('sourcelink', @$_SERVER['HTTP_HOST'] ); 
     $XML->startElement ('upload_file');
       $XML->writeAttribute('process', 'fail');         
       $XML->writeElement ('file_name', @$_FILES['uploaded']['name']);
       $XML->writeElement ('file_size', round(@$_FILES['uploaded']['size']/1000)."KB");
       $XML->writeElement ('max_size', ini_get('post_max_size'));
       $XML->writeElement ('upload_directory', ROOT.UPDATE);
     $XML->endElement ();
   $XML->endElement (); 
  } 
  $XML->endDocument ();
  $XML->flush();

  
 
          
?>